package pl.smath.expression.model.presentation;

import java.util.Iterator;
import java.util.List;
import java.util.Vector;

import pl.smath.expression.model.AbstractMultiTerm;
import pl.smath.expression.model.Term;

public class StringTerm extends AbstractMultiTerm {

	
	public StringTerm() {
		super("");
	}

	public StringTerm(String text) {
		super(text);
	}


	/**
	 * Ten term jest liczba
	 */
	@Override
	public boolean isNumber() {
		
		return false;
	}

	/**
	 * Zamiana do stringa
	 */
	public String toString(){

		String output = "";

		for(Term term : getTerms()){
			
			if(output.length() > 0){
				output += ",";
			}

			output += term.toString();
		}
		
		if(isNegative())
			output = "-" + output;
		
		return output;
	}

	@Override
	protected AbstractMultiTerm createObject() {
		return new StringTerm();
	}
	
}
